# -*- coding: utf-8 -*-  
'''
初始化字典pkl文件

Created on 2021年10月2日
@author: luoyi
'''
import os
import sys
#    取项目根目录
ROOT_PATH = os.path.abspath(os.path.dirname(__file__)).split('NLU')[0]
ROOT_PATH = ROOT_PATH + "NLU"
sys.path.append(ROOT_PATH)

from utils.dictionary import Dictionaries
from utils.relationship import Relationship


#    初始化字典，并写入pkl
Dictionaries.instance().write_pkl()
Dictionaries.instance().load_from_pkl()
print('字典总字数：', Dictionaries.instance().size())

#    初始化标注字典
Relationship.instance().load_from_file()
print('总关系数：', Relationship.instance().rel_size(), ' 实体标注数:', Relationship.instance().sot_size())

